package com.tdd.api.server.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    /**
     * 添加jwt拦截器
     * @param registry

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(jwtInterceptor())
                // 拦截所有请求，通过判断是否有 @JwtToken 注解 决定是否需要登录
                .addPathPatterns("/**")
                .excludePathPatterns(
//                        "/**",
                        "/login/**",
                        "/swagger-resources/**",
                        "/webjars/**",
                        "/v3/**",
                        "/v2/**",
                        "/swagger-ui.html/**",
                        "/doc.html/**"
                );
    }
     */
    /**
     * jwt拦截器
     * @return

    @Bean
    public JwtInterceptor jwtInterceptor() {
        return new JwtInterceptor();
    }
     */
}
